JBoss Community Archive (Read Only)

Infinispan 5.2

Talking To Infinispan Memcached Servers From Non-Java Clients

This wiki shows how to talk to Infinispan memcached server via non-java client, such as a python script.

Multi Clustered Server Tutorial

The second example showcases the distribution capabilities of Infinispan memcached severs that are not available in the original memcached implementation.

  • Start first Infinispan memcached server giving to it a port number and an Infinispan configuration supporting distribution. This configuration is the same one used for the GUI demo:

  • ./bin/startServer.sh -r memcached -c etc/config-samples/gui-demo-cache-config.xml -p 12211
  • Start a second Infinispan memcached server passing to it a different port number:

  • ./bin/startServer.sh -r memcached -c etc/config-samples/gui-demo-cache-config.xml -p 13211
  • Execute test_memcached_write.py script which basically executes several write operations againts the Infinispan memcached server bound to port 12211. If the script is executed successfully, you should see an output similar to this:

  • <li>Connecting to 127.0.0.1:12211</li><li>Testing set ['Simple_Key': Simple value] ... OK</li><li>Testing set ['Expiring_Key' : 999 : 3] ... OK</li><li>Testing increment 3 times ['Incr_Key' : starting at 1 ]</li><li>Initialise at 1 ... OK</li><li>Increment by one ... OK</li><li>Increment again ... OK</li><li>Increment yet again ... OK</li><li>Testing decrement 1 time ['Decr_Key' : starting at 4 ]</li><li>Initialise at 4 ... OK</li><li>Decrement by one ... OK</li><li>Testing decrement 2 times in one call ['Multi_Decr_Key' : 3 ]</li><li>Initialise at 3 ... OK</li><li>Decrement by 2 ... OK</li>
  • Execute test_memcached_read.py script which connects to server bound to 127.0.0.1:13211 and verifies that it can read the data that was written by the writer script to the first server. If the script is executed successfully, you should see an output similar to this:

  • <li>Connecting to 127.0.0.1:13211</li><li>Testing get ['Simple_Key'] should return Simple value ... OK</li><li>Testing get ['Expiring_Key'] should return nothing... OK</li><li>Testing get ['Incr_Key'] should return 4 ... OK</li><li>Testing get ['Decr_Key'] should return 3 ... OK</li><li>Testing get ['Multi_Decr_Key'] should return 1 ... OK</li>
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 09:20:05 UTC, last content change 2010-07-19 12:39:26 UTC.